home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / tcp / ModServer.lha / ModServer.amirx < prev    next >
Text File  |  1996-11-14  |  3KB  |  131 lines

  1. /* ModServer by Shades / fake a.k.a. Erik Lindberg 96-11-14 */
  2.  
  3. ownnick='Shades'
  4. authorpath='AmiTCP:Clients/AmIRC/rexx/'
  5. temppath='ram:'
  6.  
  7. /* Don't change below unless you know what you're doing */
  8.  
  9. options results
  10. parse arg last
  11.  
  12. address AMIRC.1
  13.  
  14. last=compress(last,D2C(1))
  15. parseline last
  16. text=line.rest
  17. nick=line.prefix
  18. first=index(nick,'!')
  19. nick=substr(nick,1,first-1)
  20.     
  21.  
  22. if text == ":GETMOD" | text == ":getmod" | text == ":GetMod" | text == ":Getmod" text == ":MODGET" | text == ":modget" | text == ":ModGet" | text == ":Modget" then do
  23.     if show('P','HIPPOPLAYER') then do
  24.         address HIPPOPLAYER
  25.         get FNAM
  26.         filename=result
  27.     end
  28.     
  29.     if show('P','DELITRACKER') then do
  30.         address DELITRACKER
  31.         status m fil
  32.         filename=result
  33.         status m dir
  34.         dirname=result
  35.         filename=insert(filename,dirname,length(dirname))
  36.     end
  37.  
  38.     archivename=substr(filename,max(lastpos(':', filename),lastpos('/', filename)) +1)    
  39.     archivename=delstr(archivename,lastpos('.',archivename))
  40.  
  41.     address command 'lha -h a 'temppath||archivename||' '||filename
  42.  
  43.     address AMIRC.1    'say /dcc send 'nick' 'temppath||archivename'.lha'
  44. end
  45.  
  46. if text == ":GETMODUNPACK" | text == ":getmodunpack" | text == ":GetModUnpack" | text == ":Getmodunpack" then do
  47.     if show('P','HIPPOPLAYER') then do
  48.         address HIPPOPLAYER
  49.         get FNAM
  50.         filename=result
  51.     end
  52.     
  53.     if show('P','DELITRACKER') then do
  54.         address DELITRACKER
  55.         status m fil
  56.         filename=result
  57.         status m dir
  58.         dirname=result
  59.         filename=insert(filename,dirname,length(dirname))
  60.     end
  61.  
  62.     address AMIRC.1    'say /dcc send 'nick' 'filename    
  63. end
  64. if text == ":MODINFO" | text == ":modinfo" | text == ":ModInfo" | text == ":Modinfo" then do
  65.     yes=0
  66.     if show('P','HIPPOPLAYER') then do
  67.             yes=1
  68.         address 'HIPPOPLAYER'
  69.         GET NAME
  70.         modname=result
  71.  
  72.         GET SIZE
  73.         size=result%1024
  74.  
  75.         address AMIRC.1 'say /msg 'nick' 'ownnick' is playing 'd2c(2)modname d2c(2)'size: 'size'K. Do a /CTCP 'ownnick' getmod to fetch it, and use getmodunpack to get it unpacked'
  76.     end
  77.  
  78.     if show('P','DELITRACKER') then do
  79.         yes=1
  80.         address 'DELITRACKER'
  81.         status m nam
  82.         modname=result
  83.  
  84.         status m dir
  85.         creator=result
  86.         creator=delstr(creator,length(creator))
  87.         creator=substr(creator,max(lastpos(':', creator),lastpos('/', creator)) +1)
  88.  
  89.         creator=seekcreator(creator)
  90.         if creator=='' then
  91.             address AMIRC.1 'say /msg 'nick' 'ownnick' is playing 'd2c(2)modname d2c(2)'. Do a /CTCP 'ownnick' getmod to fetch it, and use getmodunpack to get it unpacked'
  92.         else
  93.             address AMIRC.1 'say /msg 'nick' 'ownnick' is playing 'd2c(2)modname d2c(2)' by: 'creator'. Do a /CTCP 'ownnick' getmod to fetch it, and use getmodunpack to get it unpacked'
  94.     end
  95.     
  96.     if yes == 0 then do
  97.         address AMIRC.1 'say /msg 'nick' 'ownnick' is not playing any modules. Try again later.'
  98. end
  99.  
  100. seekcreator:
  101. parse arg creator
  102. if open('Authors',authorpath'Authornames.txt','R') then do
  103.     seek=0
  104.     DO UNTIL seek==1 | EOF('Authors')
  105.         string=READLN('Authors')
  106.         if find(string,creator) then do
  107.             creator=subword(string, 3)
  108.             seek=1
  109.         end
  110.     end
  111. close('Authors')
  112. end
  113.  
  114. if seek==0 then do
  115.     if open('Groups',authorpath'Groupnames.txt','R') then do
  116.         seek=0
  117.         DO UNTIL seek==1 | EOF('Groups')
  118.             string=READLN('Groups')
  119.             if find(string,creator) then do
  120.                 creator=subword(string, 3)
  121.                 creator=INSERT('someone in ',creator,0)
  122.                 seek=1
  123.             end
  124.         end
  125.     close('Groups')
  126.     end
  127. end
  128.  
  129. if seek==0 then creator=''
  130. return creator
  131.